<?php

namespace common\models\tsline;

use Yii;

/**
 * This is the model class for table "{{%ts_article_video}}".
 *
 * @property int $id
 * @property int $article_id 文章ID
 * @property int $video_id 视频ID
 * @property string $platform 来源平台 ali=阿里 letv=乐视
 * @property int $le_video_id 乐视视频ID
 * @property string $video_unique 乐视视频唯一标示
 * @property int $created_at
 * @property int $updated_at
 */
class TslineArticleVideo extends \yii\db\ActiveRecord {

    use \common\traits\TimestampBehavior;

    const PLATFORM_LETV = 'letv';
    const PLATFORM_ALI = 'ali';

    /**
     * @inheritdoc
     */
    public static function tableName() {
        return '{{%ts_article_video}}';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['article_id', 'video_id', 'le_video_id', 'created_at', 'updated_at'], 'integer'],
            [['article_id'], 'required'],
            [['platform'], 'string', 'max' => 20],
            [['video_unique'], 'string', 'max' => 100],
            [['path'], 'string', 'max' => 200],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'article_id' => '文章ID',
            'video_id' => '视频ID',
            'platform' => '来源平台 ali=阿里 letv=乐视',
            'path' => '文件路径',
            'le_video_id' => '乐视视频ID',
            'video_unique' => '乐视视频唯一标示',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }

}
